//
//  BaseCollectionViewCell.m
//  GOGOTravel
//
//  Created by dllo on 16/3/7.
//  Copyright © 2016年 果果. All rights reserved.
//

#import "BaseCollectionViewCell.h"

@implementation BaseCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"yeJianMoShi"] isEqualToString:@"isDay"]) {
            self.backgroundColor = UIColorFromRGB(0xF0F0F0);
        }else{
            self.backgroundColor = [UIColor lightGrayColor];
        }

    }
    self.backgroundColor = [UIColor whiteColor];
      [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeColor:) name:@"yeJianMoShi" object:nil];
    return self;
}

- (void)changeColor:(NSNotification *)notification{
    
    if ([[[NSUserDefaults standardUserDefaults]objectForKey:@"yeJianMoShi"]isEqualToString:@"isNight"]) {
        self.backgroundColor = [UIColor lightGrayColor];
    }else{
        
        self.backgroundColor = [UIColor whiteColor];
    }
    
    
}



- (void)dealloc{
    [[NSNotificationCenter defaultCenter] removeObserver:self name:@"changeColor" object:nil];
    [super dealloc];
}


@end
